import { defineStore } from 'pinia'
import {reactive,ref } from 'vue'


const useMenuStore = defineStore('menu',()=>{
    const foodList = reactive([
        {
          id:1,
          title:'红烧鸡翅根炖土豆',
          image:'https://cimg.axureshop.com/28/d0/93/28d0933e0c9f40ce99dc79bdae082541/images/%E9%A6%96%E9%A1%B5/u268.png',
          time:'一小时以上',
          num:'306人做过'
        },
        {
            id:2,
            title:'青椒胡萝卜',
            image:'https://cimg.axureshop.com/28/d0/93/28d0933e0c9f40ce99dc79bdae082541/images/%E9%A6%96%E9%A1%B5/u262.png',
            time:'16分钟',
            num:'884人做过'
          },
          {
            id:3,
            title:'豇豆炒鸡蛋',
            image:'https://cimg.axureshop.com/28/d0/93/28d0933e0c9f40ce99dc79bdae082541/images/%E9%A6%96%E9%A1%B5/u284.png',
            time:'24分钟',
            num:'1246人做过'
          },
          {
            id:4,
            title:'什锦虾仁两面黄',
            image:'https://cimg.axureshop.com/28/d0/93/28d0933e0c9f40ce99dc79bdae082541/images/%E9%A6%96%E9%A1%B5/u278.png',
            time:'20分钟',
            num:'997人做过'
          },
          {
            id:5,
            title:'红烧鸡翅根炖土豆',
            image:'https://cimg.axureshop.com/28/d0/93/28d0933e0c9f40ce99dc79bdae082541/images/%E9%A6%96%E9%A1%B5/u268.png',
            time:'一小时以上',
            num:'306人做过'
          },
          {
              id:6,
              title:'青椒胡萝卜',
              image:'https://cimg.axureshop.com/28/d0/93/28d0933e0c9f40ce99dc79bdae082541/images/%E9%A6%96%E9%A1%B5/u262.png',
              time:'16分钟',
              num:'884人做过'
            },
            {
              id:7,
              title:'豇豆炒鸡蛋',
              image:'https://cimg.axureshop.com/28/d0/93/28d0933e0c9f40ce99dc79bdae082541/images/%E9%A6%96%E9%A1%B5/u284.png',
              time:'24分钟',
              num:'1246人做过'
            },
            {
              id:8,
              title:'什锦虾仁两面黄',
              image:'https://cimg.axureshop.com/28/d0/93/28d0933e0c9f40ce99dc79bdae082541/images/%E9%A6%96%E9%A1%B5/u278.png',
              time:'20分钟',
              num:'997人做过'
            },
            {
                id:9,
                title:'红烧鸡翅根炖土豆',
                image:'https://cimg.axureshop.com/28/d0/93/28d0933e0c9f40ce99dc79bdae082541/images/%E9%A6%96%E9%A1%B5/u268.png',
                time:'一小时以上',
                num:'306人做过'
              },
              {
                  id:10,
                  title:'青椒胡萝卜',
                  image:'https://cimg.axureshop.com/28/d0/93/28d0933e0c9f40ce99dc79bdae082541/images/%E9%A6%96%E9%A1%B5/u262.png',
                  time:'16分钟',
                  num:'884人做过'
                },
                {
                  id:11,
                  title:'豇豆炒鸡蛋',
                  image:'https://cimg.axureshop.com/28/d0/93/28d0933e0c9f40ce99dc79bdae082541/images/%E9%A6%96%E9%A1%B5/u284.png',
                  time:'24分钟',
                  num:'1246人做过'
                },
                {
                  id:12,
                  title:'什锦虾仁两面黄',
                  image:'https://cimg.axureshop.com/28/d0/93/28d0933e0c9f40ce99dc79bdae082541/images/%E9%A6%96%E9%A1%B5/u278.png',
                  time:'20分钟',
                  num:'997人做过'
                },
      ])
    const goodsList = reactive([
        {
          id:1,
          image:'https://cimg.axureshop.com/28/d0/93/28d0933e0c9f40ce99dc79bdae082541/images/%E9%A6%96%E9%A1%B5/u92.png',
          title:'牛油果',
          detail:'约500克',
          price:'28.00',
          state:true,
          salePrice:'30.00'
        },
        {
          id:2,
          image:'https://cimg.axureshop.com/28/d0/93/28d0933e0c9f40ce99dc79bdae082541/images/%E9%A6%96%E9%A1%B5/u95.png',
          title:'橙子',
          detail:'约500克',
          price:'8.00',
          state:true,
          salePrice:'10.00'
        },
        {
          id:3,
          image:'https://cimg.axureshop.com/28/d0/93/28d0933e0c9f40ce99dc79bdae082541/images/%E9%A6%96%E9%A1%B5/u110.png',
          title:'油菜',
          detail:'约500克',
          price:'2.00',
          state:true,
          salePrice:'5.00'
        },
        {
          id:4,
          image:'https://cimg.axureshop.com/28/d0/93/28d0933e0c9f40ce99dc79bdae082541/images/%E9%A6%96%E9%A1%B5/u118.png',
          title:'猪前尖',
          detail:'约500克',
          price:'25.00',
          state:true,
          salePrice:'28.00'
        },
        {
          id:5,
          image:'https://cimg.axureshop.com/28/d0/93/28d0933e0c9f40ce99dc79bdae082541/images/%E9%A6%96%E9%A1%B5/u132.png',
          title:'越南巴沙鱼',
          detail:'约450克',
          price:'30.00',
          state:true,
          salePrice:'40.00'
        },
        {
          id:5,
          image:'https://cimg.axureshop.com/28/d0/93/28d0933e0c9f40ce99dc79bdae082541/images/%E9%A6%96%E9%A1%B5/u167.png',
          title:'河北梨',
          detail:'约1500克',
          price:'12.00',
          state:true,
          salePrice:'15.00'
        },
        {
          id:6,
          image:'https://cimg.axureshop.com/28/d0/93/28d0933e0c9f40ce99dc79bdae082541/images/%E9%A6%96%E9%A1%B5/u184.png',
          title:'澳洲黑毛安格斯牛排',
          detail:'1200克',
          price:'199.00',
          state:true,
          salePrice:'299.00'
        },
        {
          id:7,
          image:'https://cimg.axureshop.com/28/d0/93/28d0933e0c9f40ce99dc79bdae082541/images/%E9%A6%96%E9%A1%B5/u251.png',
          title:'大鲜虾',
          detail:'300克',
          price:'66.00',
          state:true,
          salePrice:'100.00'
        },
        {
          id:8,
          image:'https://cimg.axureshop.com/28/d0/93/28d0933e0c9f40ce99dc79bdae082541/images/%E9%A6%96%E9%A1%B5/u255.png',
          title:'排骨',
          detail:'三斤装',
          price:'69.00',
          state:true,
          salePrice:'99.00'
        },
      ])  
    let commitList = reactive([])
    const addCommit = (val) =>{
      commitList.push(val)
    }
    const removeGoods = ()=>{
      commitList.pop()
    }
    let check = ref(false)
      return{
        foodList,
        goodsList,
        addCommit,
        commitList,
        removeGoods,
        check
      }
})

export default useMenuStore